import request from '@/utils/request';

export async function list(payload) {
  return request(`/back/auth/role/list`)
}

export async function page(payload) {
  return request(`/back/auth/role/page?pageIndex=${payload.pageIndex}&pageSize=${payload.pageSize}`)
}

export async function get(id) {
  return request(`/back/auth/role/get/${id}`);
}

export async function del(payload) {
  return request(`/back/auth/role/del/${payload.uid}`, {
    method: 'POST'
  });
}

export async function delBatch(payload) {
  return request(`/back/auth/role/delBatch`, {
    method: 'POST',
    body: payload
  });
}

export async function add(payload) {
  return request(`/back/auth/role/save`, {
    method: 'POST',
    body: payload
  });
}

export async function update(payload) {
  return request(`/back/auth/role/update`, {
    method: 'PUT',
    body: payload
  });
}

export async function listMenuIds(roleId) {
  return request(`/back/auth/role/listMenuIds/${roleId}`);
}

export async function updateMenuIds(payload) {
  return request(`/back/auth/role/updateMenuIds`, {
    method: 'POST',
    body: payload
  });
}